<template>
<div>
    <ul>
    <li v-for="m in MessageList" :key="m.id">
        <!-- 携带字符串的params写法 -->
        <!-- <router-link :to="`/home/message/deatail/${m.id}/${m.title}`">{{m.title}}</router-link> -->
        <!-- 对象写法 如果用params 一定要用name不能用path来指定路径 -->
        <router-link :to="{
           name:'xiangqing',
           params:{
            id:m.id,
            title:m.title,
           }
        }">{{m.title}}
        </router-link>
    </li>
    </ul>
    <hr>
    <router-view></router-view>
</div>    
</template>

<script>
export default {
   name:'Message',
   data() {
    return {
        MessageList:[
            {id:'001',title:'文章1'},
            {id:'002',title:'文章2'},
            {id:'003',title:'文章3'},
        ]
    }
   },
}
</script>

<style>

</style>